<?php if(count($this->pages)): ?>
    <?php foreach ($this->pages as $item): 
        echo $this->item($item, $this->user_id, true,$this->vistate,$this->site);?>
    <?php endforeach;?>

<?php endif; ?>
    
   <?php if($this->vistate == 1 || $this->vistate == 2): ?>
    <?php if(!empty($this->user_id)): ?>
    <?php if($this->isRanked == 0): ?>
   <div id="Raiting" <?php if($this->vistate == 2) echo 'hidden';?>> 
       <b><?php echo $this->translate('Оцените лекцию')?>: </b>
  <dl class="star-rating" style="margin-top: -18px;padding-left:11%;">
    <dd>
    <ol>
      <li><a href="#" class="star1" title="Рейтинг 1 из 5" onClick ="goRaiting(1); return false;"><?php echo $this->translate('Ужасно')?></a></li>
      <li><a href="#" class="star2" title="Рейтинг 2 из 5" onClick ="goRaiting(2); return false;"><?php echo $this->translate('Плохо')?></a></li>
      <li><a href="#" class="star3" title="Рейтинг 3 из 5" onClick ="goRaiting(3); return false;"><?php echo $this->translate('Нормально')?></a></li>
      <li class="current" style="width:80px"><a href="#" class="star4" title="Рейтинг 4 из 5" onClick ="goRaiting(4); return false;"><?php echo $this->translate('Хорошо')?></a></li>
      <li><a href="#" class="star5" title="Рейтинг 5 из 5" onClick ="goRaiting(5); return false;"><?php echo $this->translate('Отлично')?></a></li>
    </ol>
  </dd>
</dl>
   </div>
    <?php else: ?>
            <p style="margin-top: -18px;"><?php echo $this->translate('Вы уже оценивали эту лекцию.')?> </p>
    <?php endif; ?>
    <script type="text/javascript">
        function goRaiting(choice){
            var val = choice;

    $('#Raiting').html("<?php echo $this->translate('Ваша оценка учтена.')?>");

                //alert('<?php echo $this->site; ?>'+'/lectures/ajaxrait/ra/' + val +'/lid/' + <?php echo $this->lec_id; ?> + '/uid/' + <?php 
    echo $this->user_id; ?> );
                $.post('<?php echo $this->site; ?>'+'/lectures/ajaxrait/ra/' + val +'/lid/' + <?php echo $this->lec_id; ?> + '/uid/' + <?php 
                    echo $this->user_id; ?>,
                            function(data){
                            $('#RankAct').html(data);
                            //alert(data);
                        });
        }
    </script>
    	
	
    <?php else: ?>
    <div id="Raiting" <?php if($this->vistate == 2) echo 'hidden';?>> 
    <p style="margin-top: -18px;"><b><?php echo $this->translate('Оцените лекцию')?>:</b> 
        <a href="<?php echo $this->url(array(
                    'controller'=>'auth',
                    'action'=>'login'),false,true) ?>"> 
                    <?php echo $this->translate('необходима авторизация.')?></a></p>
    </div>
	<?php endif; ?>
<?php endif; ?>
<script type="text/javascript" src="//yandex.st/share/share.js" charset="utf-8"></script>
	<div id="yashare_auto_init" class="yashare-auto-init" data-yashareL10n="ru" data-yashareType="button" data-yashareQuickServices="vkontakte,facebook,twitter,odnoklassniki,gplus" <?php if($this->vistate == 2) echo 'hidden';?>></div> 
    
        <table id="comments" <?php if($this->vistate == 2) echo 'hidden';?> cellpadding="4" cellspacing="0" border="0" width="80%" style="margin-top: 10px;" >
          <tr>
            <td style="vertical-align: top;">
				<div id="vk_comments" ></div>
				<script type="text/javascript">
				VK.Widgets.Comments("vk_comments", {limit: 10, width: "470", attach: "*"});
				</script>
			</td>
			<td style="vertical-align: top;">
				<div class="fb-comments" data-href="<?php echo $_SERVER['REQUEST_URI'] ?>" data-width="470" data-num-posts="10" ></div>
			</td>
	    </tr>
    </table>
    
